#ifndef IO_H_
#define IO_H_
#include <slave.h>
class EcIO : public Slave
{
public:
    EcIO();
    EcIO(ec_master_t* master, int index);
    ~EcIO();

    bool Parse(EcXml &ecxml, ec_master_t* master, int index);

    /**
     * @Func
     *      SetPos
     * @Berif
     *      set target position
     * @Input
     *      targetpos: the position of targetpos
     * @Output
     *      none
     */
    void SetPos(int32_t targetPos);

    uint32_t GetAnalog(int32_t pdo);
    uint32_t GetDigital();

    /**
     * @Func
     *      Retrieve
     * @Berif
     *      Read the feedback from the slave
     * @Input
     *      domainPtr: the ethercat frame of data domain
     * @Output
     *      none
     */
    virtual void Retrieve(uint8_t* domainPtr);

    /**
     * @Func
     *      Publisher
     * @Berif
     *      Write data to be distributed to slave
     * @Input
     *      domainPtr: the ethercat frame of data domain
     * @Output
     *      none
     */
    virtual void Publisher(uint8_t* domainPtr);
};

#endif
